package com.neuqsoft.zwytj.demo.api;

import com.neuqsoft.zwytj.demo.dto.*;
import com.neuqsoft.zwytj.demo.service.DemoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Desc描述: <br>
 * @Author: zhangfuxing
 * @Date: 2022/3/23
 **/
@Api(tags = "测试demo")
@RequestMapping("/api/demo/v0")
@RestController
public class DemoApi {
    @Autowired
    private DemoService demoService;

    @ApiOperation(value = "测试厂商暂存参数demo")
    @PostMapping("/cs/param")
    public Object getTestFrocs(@RequestBody ParamSaveDTO dto) throws Exception {
        return demoService.getTestFrocs(dto);
    }

    @ApiOperation(value = "测试页面解析暂存参数demo")
    @PostMapping("/page/paramCert/decode")
    public Object decodeParamCert(@RequestBody ParamCertDecodeDTO dto) {
        return demoService.decodeParamCert(dto);
    }

    @ApiOperation(value = "测试厂商SM4解密demo")
    @PostMapping("/page/sm4/decode")
    public Object decodeSm4(@RequestBody DecodeSm4DTO dto) {
        return demoService.decodeSm4(dto);
    }

    @ApiOperation(value = "测试厂商单条统计demo")
    @PostMapping("/cs/statistic/single")
    public Object singleStatistic(@RequestBody SingleStatisticDTO dto) {
        return demoService.singleStatistic(dto);
    }

    @ApiOperation(value = "测试厂商批量统计demo")
    @PostMapping("/cs/statistic/batch")
    public Object batchStatistic(@RequestBody BatchStatisticDTO dto) {
        return demoService.batchStatistic(dto);
    }
}
